# ##########################################
SET( INCLUDE_DIRS
	${CMAKE_CURRENT_LIST_DIR}/Include
	${CMAKE_CURRENT_LIST_DIR}/../Core/Include
)
INCLUDE_DIRECTORIES( ${INCLUDE_DIRS} )


# ##########################################
SET( INCLUDE_FILES
	Include/Math/Math.hpp
)

# ##########################################
SET( SOURCE_FILES
	Source/Math.cpp
)


# ##########################################
ADD_DEFINITIONS( -DBUILDING_MATH )
ADD_DEFINITIONS( -DARM_NEON_GCC_COMPATIBILITY=1 )

ADD_LIBRARY( Math
	STATIC
	${INCLUDE_FILES}
	${SOURCE_FILES}
)

# ##########################################
# Export the include directory.
SET( MATH_INCLUDE_DIRS ${INCLUDE_DIRS} PARENT_SCOPE )


# ##########################################
# Make a unit test holder for the Math library.
IF( BUILD_UNIT_TESTS )
	# Add the gmock include directories.
	INCLUDE_DIRECTORIES( ${GMOCK_INCLUDE_DIRS} )

	ADD_EXECUTABLE( _TestMath
		Tests/Main.cpp
		Tests/TestAll.hpp
	)
	TARGET_LINK_LIBRARIES( _TestMath
		Math
		GMock
		${CMAKE_THREAD_LIBS_INIT}
	)

	ADD_TEST( NAME
		_TestMath
		COMMAND
		_TestMath
	)
ENDIF( BUILD_UNIT_TESTS )
